/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gui.multimedia;

import java.util.ArrayList;
import javax.swing.ListModel;
import javax.swing.event.ListDataListener;
import multimedia.AudioSongModel;

/**
 *
 * @author thomas
 */
public class MultimediaSongListModel implements ListModel {

    private ArrayList<AudioSongModel> _myItemList;

    /**
     * Create an MultimediaSongListModel to display songs in a list
     * To do this, you need to call constructor with an ArrayList of AudioSongModel
     * @param itemList ArrayList<AudioSongModel>
     */
    public MultimediaSongListModel(ArrayList<AudioSongModel> itemList) {
        _myItemList = itemList;
    }

    /**
     * Create an MultimediaSongListModel to display songs in a list
     * To do this, you need to call constructor with an MultimediaSongListModel
     * @param obj MultimediaSongListModel
     */
    public MultimediaSongListModel(MultimediaSongListModel obj) {
        _myItemList = obj.getItemList();
    }
    
    @Override
    public int getSize() {
        return _myItemList.size();
    }

    @Override
    public Object getElementAt(int i) {
        return _myItemList.get(i);
    }

    @Override
    public void addListDataListener(ListDataListener ll) {
    }

    @Override
    public void removeListDataListener(ListDataListener ll) {
    }

    /**
     * @return the _myItemList
     */
    public ArrayList<AudioSongModel> getItemList() {
        return _myItemList;
    }

    /**
     * @param myItemList the _myItemList to set
     */
    public void setItemList(ArrayList<AudioSongModel> myItemList) {
        this._myItemList = myItemList;
    }
}
